<?php $this->load->view('admin/public/head.html', array('css' => array(
'/assets/admin/css/admin/common.css'
))); ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper admin-user-list" ng-controller="admin-promoter-ticket-index-controller">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            优惠券
            <small>通过平台发布的优惠卷抵扣，领取后可以直接消费</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="###"><i class="fa fa-dashboard"></i>后台首页</a></li>
            <li class="active">优惠券</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">

        <div class="row">
            <div class="col-md-12">
                <div class="box">
                    <div class="box-header with-border">
                        <h3 class="box-title">优惠券列表</h3>
                        <div class="box-tools">
                            <div class="input-group input-group-sm">
                                <a href="/promoter/ticket/add" class="btn btn-sm btn-info" style="background: #00a65a; border: none;"><i class="fa fa-plus"></i> 添加优惠券</a>
                            </div>
                        </div>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body">
                        <table class="table table-bordered">
                            <tr>
                                <th class="text-center" style="width: 40px">#</th>
                                <th>名称</th>
                                <th class="text-center">使用平台</th>
                                <th class="text-center">起止时间</th>
                                <th class="text-center">满减条件</th>
                                <th class="text-center">发放数量</th>
                                <th class="text-center">已领取</th>
                                <th class="text-center">状态</th>
                                <th class="text-center" style="width: 180px">操作</th>
                            </tr>
                            <tr ng-repeat="(index, t) in tickets">
                                <td class="text-center" ng-bind="t.id"></td>
                                <td class="text-center" ng-bind="t.name"></td>
                                <td class="text-center">
                                    <span class="badge bg-green" ng-bind="'微信'" ng-if="t.wechat == 1"></span>
                                    <span class="badge bg-purple" ng-bind="'客户端'" ng-if="t.app == 1"></span>
                                </td>
                                <td class="text-center" ng-bind="t.time_start + ' 到 ' + t.time_end"></td>
                                <td class="text-center" ng-bind="'满 ' + t.limit_amount + ' 减 ' + t.amount"></td>
                                <td class="text-center" ng-bind="t.num"></td>
                                <td class="text-center" ng-bind="t.gets"></td>
                                <td class="text-center">
                                    <span class="badge bg-green" ng-if="t.status == 1">启用</span>
                                    <span class="badge bg-warning" ng-if="t.status != 1">禁用</span>
                                </td>
                                <td class="text-center">
                                    <a href="/promoter/ticket/edit?id={{ t.id }}" class="btn btn-link btn-xs"><i class="fa fa-pencil"></i> 编辑</a>
                                    <a href="javascript:void(0);" ng-click="deleteTicket(index)" class="btn btn-link btn-xs"><i class="fa fa-trash"></i> 删除</a>
                                    <a href="javascript:void(0);" ng-click="changeStatus(index)" class="btn btn-link btn-xs"><i class="fa fa-eye-slash"></i> 禁用</a>
                                </td>
                            </tr>

                        </table>
                    </div>

                </div>
                <!-- /.box -->
            </div>
        </div>

    </section>
    <!-- /.content -->
</div>

<!-- /.content-wrapper -->
<?php $this->load->view('admin/public/foot.html', array('js' => array(
'/assets/admin/js/promoter/ticket/index.js'
)));
?>

